\(\int \frac {\sqrt {a d e+(c d^2+a e^2) x+c d e x^2}}{\sqrt {d+e x} (f+g x)^2} \, dx\) [685]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [B] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 46, antiderivative size = 132 \[ \int \frac {\sqrt {a d e+\left (c d^2+a e^2\right ) x+c d e x^2}}{\sqrt {d+e x} (f+g x)^2} \, dx=-\frac {\sqrt {a d e+\left (c d^2+a e^2\right ) x+c d e x^2}}{g \sqrt {d+e x} (f+g x)}+\frac {c d \arctan \left (\frac {\sqrt {g} \sqrt {a d e+\left (c d^2+a e^2\right ) x+c d e x^2}}{\sqrt {c d f-a e g} \sqrt {d+e x}}\right )}{g^{3/2} \sqrt {c d f-a e g}} \]

[Out]

c*d*arctan(g^(1/2)*(a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^(1/2)/(-a*e*g+c*d*f)^(1/2)/(e*x+d)^(1/2))/g^(3/2)/(-a*e*g
+c*d*f)^(1/2)-(a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^(1/2)/g/(g*x+f)/(e*x+d)^(1/2)

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {876, 888, 211} \[ \int \frac {\sqrt {a d e+\left (c d^2+a e^2\right ) x+c d e x^2}}{\sqrt {d+e x} (f+g x)^2} \, dx=\frac {c d \arctan \left (\frac {\sqrt {g} \sqrt {x \left (a e^2+c d^2\right )+a d e+c d e x^2}}{\sqrt {d+e x} \sqrt {c d f-a e g}}\right )}{g^{3/2} \sqrt {c d f-a e g}}-\frac {\sqrt {x \left (a e^2+c d^2\right )+a d e+c d e x^2}}{g \sqrt {d+e x} (f+g x)} \]

[In]

Int[Sqrt[a*d*e + (c*d^2 + a*e^2)*x + c*d*e*x^2]/(Sqrt[d + e*x]*(f + g*x)^2),x]

[Out]

-(Sqrt[a*d*e + (c*d^2 + a*e^2)*x + c*d*e*x^2]/(g*Sqrt[d + e*x]*(f + g*x))) + (c*d*ArcTan[(Sqrt[g]*Sqrt[a*d*e +
 (c*d^2 + a*e^2)*x + c*d*e*x^2])/(Sqrt[c*d*f - a*e*g]*Sqrt[d + e*x])])/(g^(3/2)*Sqrt[c*d*f - a*e*g])

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 876

Int[((d_) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :>
Simp[(d + e*x)^m*(f + g*x)^(n + 1)*((a + b*x + c*x^2)^p/(g*(n + 1))), x] + Dist[c*(m/(e*g*(n + 1))), Int[(d +
e*x)^(m + 1)*(f + g*x)^(n + 1)*(a + b*x + c*x^2)^(p - 1), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[e*f
 - d*g, 0] && NeQ[b^2 - 4*a*c, 0] && EqQ[c*d^2 - b*d*e + a*e^2, 0] &&  !IntegerQ[p] && EqQ[m + p, 0] && GtQ[p,
 0] && LtQ[n, -1] &&  !(IntegerQ[n + p] && LeQ[n + p + 2, 0])

Rule 888

Int[Sqrt[(d_) + (e_.)*(x_)]/(((f_.) + (g_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[
2*e^2, Subst[Int[1/(c*(e*f + d*g) - b*e*g + e^2*g*x^2), x], x, Sqrt[a + b*x + c*x^2]/Sqrt[d + e*x]], x] /; Fre
eQ[{a, b, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] && NeQ[b^2 - 4*a*c, 0] && EqQ[c*d^2 - b*d*e + a*e^2, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {\sqrt {a d e+\left (c d^2+a e^2\right ) x+c d e x^2}}{g \sqrt {d+e x} (f+g x)}+\frac {(c d) \int \frac {\sqrt {d+e x}}{(f+g x) \sqrt {a d e+\left (c d^2+a e^2\right ) x+c d e x^2}} \, dx}{2 g} \\ & = -\frac {\sqrt {a d e+\left (c d^2+a e^2\right ) x+c d e x^2}}{g \sqrt {d+e x} (f+g x)}+\frac {\left (c d e^2\right ) \text {Subst}\left (\int \frac {1}{-e \left (c d^2+a e^2\right ) g+c d e (e f+d g)+e^2 g x^2} \, dx,x,\frac {\sqrt {a d e+\left (c d^2+a e^2\right ) x+c d e x^2}}{\sqrt {d+e x}}\right )}{g} \\ & = -\frac {\sqrt {a d e+\left (c d^2+a e^2\right ) x+c d e x^2}}{g \sqrt {d+e x} (f+g x)}+\frac {c d \tan ^{-1}\left (\frac {\sqrt {g} \sqrt {a d e+\left (c d^2+a e^2\right ) x+c d e x^2}}{\sqrt {c d f-a e g} \sqrt {d+e x}}\right )}{g^{3/2} \sqrt {c d f-a e g}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.24 (sec) , antiderivative size = 110, normalized size of antiderivative = 0.83 \[ \int \frac {\sqrt {a d e+\left (c d^2+a e^2\right ) x+c d e x^2}}{\sqrt {d+e x} (f+g x)^2} \, dx=\frac {\sqrt {(a e+c d x) (d+e x)} \left (-\frac {\sqrt {g}}{f+g x}+\frac {c d \arctan \left (\frac {\sqrt {g} \sqrt {a e+c d x}}{\sqrt {c d f-a e g}}\right )}{\sqrt {c d f-a e g} \sqrt {a e+c d x}}\right )}{g^{3/2} \sqrt {d+e x}} \]

[In]

Integrate[Sqrt[a*d*e + (c*d^2 + a*e^2)*x + c*d*e*x^2]/(Sqrt[d + e*x]*(f + g*x)^2),x]

[Out]

(Sqrt[(a*e + c*d*x)*(d + e*x)]*(-(Sqrt[g]/(f + g*x)) + (c*d*ArcTan[(Sqrt[g]*Sqrt[a*e + c*d*x])/Sqrt[c*d*f - a*
e*g]])/(Sqrt[c*d*f - a*e*g]*Sqrt[a*e + c*d*x])))/(g^(3/2)*Sqrt[d + e*x])

Maple [A] (verified)

Time = 0.55 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.14

method result size
default \(\frac {\left (-\operatorname {arctanh}\left (\frac {g \sqrt {c d x +a e}}{\sqrt {\left (a e g -c d f \right ) g}}\right ) c d g x -\operatorname {arctanh}\left (\frac {g \sqrt {c d x +a e}}{\sqrt {\left (a e g -c d f \right ) g}}\right ) c d f -\sqrt {c d x +a e}\, \sqrt {\left (a e g -c d f \right ) g}\right ) \sqrt {\left (c d x +a e \right ) \left (e x +d \right )}}{\sqrt {e x +d}\, \sqrt {c d x +a e}\, g \left (g x +f \right ) \sqrt {\left (a e g -c d f \right ) g}}\) \(151\)

[In]

int((a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^(1/2)/(g*x+f)^2/(e*x+d)^(1/2),x,method=_RETURNVERBOSE)

[Out]

(-arctanh(g*(c*d*x+a*e)^(1/2)/((a*e*g-c*d*f)*g)^(1/2))*c*d*g*x-arctanh(g*(c*d*x+a*e)^(1/2)/((a*e*g-c*d*f)*g)^(
1/2))*c*d*f-(c*d*x+a*e)^(1/2)*((a*e*g-c*d*f)*g)^(1/2))*((c*d*x+a*e)*(e*x+d))^(1/2)/(e*x+d)^(1/2)/(c*d*x+a*e)^(
1/2)/g/(g*x+f)/((a*e*g-c*d*f)*g)^(1/2)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 260 vs. \(2 (116) = 232\).

Time = 0.44 (sec) , antiderivative size = 562, normalized size of antiderivative = 4.26 \[ \int \frac {\sqrt {a d e+\left (c d^2+a e^2\right ) x+c d e x^2}}{\sqrt {d+e x} (f+g x)^2} \, dx=\left [-\frac {{\left (c d e g x^{2} + c d^{2} f + {\left (c d e f + c d^{2} g\right )} x\right )} \sqrt {-c d f g + a e g^{2}} \log \left (-\frac {c d e g x^{2} - c d^{2} f + 2 \, a d e g - {\left (c d e f - {\left (c d^{2} + 2 \, a e^{2}\right )} g\right )} x - 2 \, \sqrt {c d e x^{2} + a d e + {\left (c d^{2} + a e^{2}\right )} x} \sqrt {-c d f g + a e g^{2}} \sqrt {e x + d}}{e g x^{2} + d f + {\left (e f + d g\right )} x}\right ) + 2 \, \sqrt {c d e x^{2} + a d e + {\left (c d^{2} + a e^{2}\right )} x} {\left (c d f g - a e g^{2}\right )} \sqrt {e x + d}}{2 \, {\left (c d^{2} f^{2} g^{2} - a d e f g^{3} + {\left (c d e f g^{3} - a e^{2} g^{4}\right )} x^{2} + {\left (c d e f^{2} g^{2} - a d e g^{4} + {\left (c d^{2} - a e^{2}\right )} f g^{3}\right )} x\right )}}, -\frac {{\left (c d e g x^{2} + c d^{2} f + {\left (c d e f + c d^{2} g\right )} x\right )} \sqrt {c d f g - a e g^{2}} \arctan \left (\frac {\sqrt {c d e x^{2} + a d e + {\left (c d^{2} + a e^{2}\right )} x} \sqrt {c d f g - a e g^{2}} \sqrt {e x + d}}{c d e g x^{2} + a d e g + {\left (c d^{2} + a e^{2}\right )} g x}\right ) + \sqrt {c d e x^{2} + a d e + {\left (c d^{2} + a e^{2}\right )} x} {\left (c d f g - a e g^{2}\right )} \sqrt {e x + d}}{c d^{2} f^{2} g^{2} - a d e f g^{3} + {\left (c d e f g^{3} - a e^{2} g^{4}\right )} x^{2} + {\left (c d e f^{2} g^{2} - a d e g^{4} + {\left (c d^{2} - a e^{2}\right )} f g^{3}\right )} x}\right ] \]

[In]

integrate((a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^(1/2)/(g*x+f)^2/(e*x+d)^(1/2),x, algorithm="fricas")

[Out]

[-1/2*((c*d*e*g*x^2 + c*d^2*f + (c*d*e*f + c*d^2*g)*x)*sqrt(-c*d*f*g + a*e*g^2)*log(-(c*d*e*g*x^2 - c*d^2*f +
2*a*d*e*g - (c*d*e*f - (c*d^2 + 2*a*e^2)*g)*x - 2*sqrt(c*d*e*x^2 + a*d*e + (c*d^2 + a*e^2)*x)*sqrt(-c*d*f*g +
a*e*g^2)*sqrt(e*x + d))/(e*g*x^2 + d*f + (e*f + d*g)*x)) + 2*sqrt(c*d*e*x^2 + a*d*e + (c*d^2 + a*e^2)*x)*(c*d*
f*g - a*e*g^2)*sqrt(e*x + d))/(c*d^2*f^2*g^2 - a*d*e*f*g^3 + (c*d*e*f*g^3 - a*e^2*g^4)*x^2 + (c*d*e*f^2*g^2 -
a*d*e*g^4 + (c*d^2 - a*e^2)*f*g^3)*x), -((c*d*e*g*x^2 + c*d^2*f + (c*d*e*f + c*d^2*g)*x)*sqrt(c*d*f*g - a*e*g^
2)*arctan(sqrt(c*d*e*x^2 + a*d*e + (c*d^2 + a*e^2)*x)*sqrt(c*d*f*g - a*e*g^2)*sqrt(e*x + d)/(c*d*e*g*x^2 + a*d
*e*g + (c*d^2 + a*e^2)*g*x)) + sqrt(c*d*e*x^2 + a*d*e + (c*d^2 + a*e^2)*x)*(c*d*f*g - a*e*g^2)*sqrt(e*x + d))/
(c*d^2*f^2*g^2 - a*d*e*f*g^3 + (c*d*e*f*g^3 - a*e^2*g^4)*x^2 + (c*d*e*f^2*g^2 - a*d*e*g^4 + (c*d^2 - a*e^2)*f*
g^3)*x)]

Sympy [F]

\[ \int \frac {\sqrt {a d e+\left (c d^2+a e^2\right ) x+c d e x^2}}{\sqrt {d+e x} (f+g x)^2} \, dx=\int \frac {\sqrt {\left (d + e x\right ) \left (a e + c d x\right )}}{\sqrt {d + e x} \left (f + g x\right )^{2}}\, dx \]

[In]

integrate((a*d*e+(a*e**2+c*d**2)*x+c*d*e*x**2)**(1/2)/(g*x+f)**2/(e*x+d)**(1/2),x)

[Out]

Integral(sqrt((d + e*x)*(a*e + c*d*x))/(sqrt(d + e*x)*(f + g*x)**2), x)

Maxima [F]

\[ \int \frac {\sqrt {a d e+\left (c d^2+a e^2\right ) x+c d e x^2}}{\sqrt {d+e x} (f+g x)^2} \, dx=\int { \frac {\sqrt {c d e x^{2} + a d e + {\left (c d^{2} + a e^{2}\right )} x}}{\sqrt {e x + d} {\left (g x + f\right )}^{2}} \,d x } \]

[In]

integrate((a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^(1/2)/(g*x+f)^2/(e*x+d)^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt(c*d*e*x^2 + a*d*e + (c*d^2 + a*e^2)*x)/(sqrt(e*x + d)*(g*x + f)^2), x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 315 vs. \(2 (116) = 232\).

Time = 0.36 (sec) , antiderivative size = 315, normalized size of antiderivative = 2.39 \[ \int \frac {\sqrt {a d e+\left (c d^2+a e^2\right ) x+c d e x^2}}{\sqrt {d+e x} (f+g x)^2} \, dx=-\frac {{\left (\frac {\sqrt {{\left (e x + d\right )} c d e - c d^{2} e + a e^{3}} c d e^{2}}{{\left (c d e^{2} f - a e^{3} g + {\left ({\left (e x + d\right )} c d e - c d^{2} e + a e^{3}\right )} g\right )} g} - \frac {c d e \arctan \left (\frac {\sqrt {{\left (e x + d\right )} c d e - c d^{2} e + a e^{3}} g}{\sqrt {c d f g - a e g^{2}} e}\right )}{\sqrt {c d f g - a e g^{2}} g} + \frac {c d e^{2} f \arctan \left (\frac {\sqrt {-c d^{2} e + a e^{3}} g}{\sqrt {c d f g - a e g^{2}} e}\right ) - c d^{2} e g \arctan \left (\frac {\sqrt {-c d^{2} e + a e^{3}} g}{\sqrt {c d f g - a e g^{2}} e}\right ) - \sqrt {-c d^{2} e + a e^{3}} \sqrt {c d f g - a e g^{2}} e}{\sqrt {c d f g - a e g^{2}} e f g - \sqrt {c d f g - a e g^{2}} d g^{2}}\right )} {\left | e \right |}}{e^{2}} \]

[In]

integrate((a*d*e+(a*e^2+c*d^2)*x+c*d*e*x^2)^(1/2)/(g*x+f)^2/(e*x+d)^(1/2),x, algorithm="giac")

[Out]

-(sqrt((e*x + d)*c*d*e - c*d^2*e + a*e^3)*c*d*e^2/((c*d*e^2*f - a*e^3*g + ((e*x + d)*c*d*e - c*d^2*e + a*e^3)*
g)*g) - c*d*e*arctan(sqrt((e*x + d)*c*d*e - c*d^2*e + a*e^3)*g/(sqrt(c*d*f*g - a*e*g^2)*e))/(sqrt(c*d*f*g - a*
e*g^2)*g) + (c*d*e^2*f*arctan(sqrt(-c*d^2*e + a*e^3)*g/(sqrt(c*d*f*g - a*e*g^2)*e)) - c*d^2*e*g*arctan(sqrt(-c
*d^2*e + a*e^3)*g/(sqrt(c*d*f*g - a*e*g^2)*e)) - sqrt(-c*d^2*e + a*e^3)*sqrt(c*d*f*g - a*e*g^2)*e)/(sqrt(c*d*f
*g - a*e*g^2)*e*f*g - sqrt(c*d*f*g - a*e*g^2)*d*g^2))*abs(e)/e^2

Mupad [F(-1)]

Timed out. \[ \int \frac {\sqrt {a d e+\left (c d^2+a e^2\right ) x+c d e x^2}}{\sqrt {d+e x} (f+g x)^2} \, dx=\int \frac {\sqrt {c\,d\,e\,x^2+\left (c\,d^2+a\,e^2\right )\,x+a\,d\,e}}{{\left (f+g\,x\right )}^2\,\sqrt {d+e\,x}} \,d x \]

[In]

int((x*(a*e^2 + c*d^2) + a*d*e + c*d*e*x^2)^(1/2)/((f + g*x)^2*(d + e*x)^(1/2)),x)

[Out]

int((x*(a*e^2 + c*d^2) + a*d*e + c*d*e*x^2)^(1/2)/((f + g*x)^2*(d + e*x)^(1/2)), x)